from sqlalchemy import Column, String, Integer, DateTime, ForeignKey
from .archivable import Archivable
from app.db.base_class import Base
from sqlalchemy.dialects.postgresql import UUID


class BroadcastLog(Base, Archivable):
    __tablename__ = "broadcast_log"

    broadcast_task_id = Column(UUID(as_uuid=True), ForeignKey("broadcast_task.id"))
    broadcast_time = Column(DateTime, nullable=False, comment="播报时间")
    target_id = Column(String, nullable=False, comment="播报对象ID")
    target_name = Column(String, nullable=False, comment="播报对象名称")
    target_department = Column(String, nullable=False, comment="所属部门")
    broadcast_task_name = Column(String, nullable=False, comment="播报任务名称")
    trigger_type = Column(String, nullable=False, comment="播报条件")
